﻿namespace TrinityEngine
{
    public static class Random
    {
        private static System.Random _random = new System.Random();

        public static float value => (float)_random.NextDouble();

        public static int Range(int minInclusive, int maxExclusive)
        {
            if (maxExclusive < minInclusive)
            {
                int temp = maxExclusive;
                maxExclusive = minInclusive;
                minInclusive = temp;
            }

            return minInclusive + (int)((maxExclusive - minInclusive) * value);
        }

        public static float Range(float minInclusive, float maxExclusive)
        {
            if (maxExclusive < minInclusive)
            {
                float temp = maxExclusive;
                maxExclusive = minInclusive;
                minInclusive = temp;
            }

            return minInclusive + (maxExclusive - minInclusive) * value;
        }
    }
}
